<!DOCTYPE html>
<html lang="zh">
<head>
    <meta charset="UTF-8">
    <title>待办事项</title>
</head>
<body>
<h1>TODO - Web版</h1>
<label for="todo-item">请输入待办事项名称: </label>
<input id="todo-item" type="text" name="todo-item" />
<br><br>
<button onclick="addTodo()">添加</button>
<br><br>
<h3>待办事项列表: </h3>
<div id="list">

</div>

<script type="text/javascript">
    function addTodo() {
        var item = document.getElementById("todo-item").value;
        var list = document.getElementById("list");
        list.innerHTML = list.innerHTML + "<p>" + item + "</p>";
    }
</script>
</body>
</html>